package cn.nawang.ebeim.api.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import cn.nawang.ebeim.api.utils.DateUtils;

/**
 * TbDepartment entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "tb_push_message", catalog = "ebeim")
public class PushMessage implements java.io.Serializable {

  // Fields

  @Id
  @Column(name = "id", unique = true, nullable = false)
  @GeneratedValue(strategy = GenerationType.AUTO)
  private Integer id;
  
  @Column(name = "push_message_title")
  private String pushMessageTitle;
  
  @Column(name = "push_message_content")
  private String pushMessageContent;
  
  @Column(name = "create_time")
  private Long createTime;
  
  @Column(name = "create_user_id")
  private String createUserId;
  
  @Transient
  private String createTimeStr;
  @Transient
  private String createUserName;

  public PushMessage(){
    
  }
  public PushMessage(Integer id, String pushMessageTitle, String pushMessageContent,
      Long createTime, String createUserId, String createUserName) {
    super();
    this.id = id;
    this.pushMessageTitle = pushMessageTitle;
    this.pushMessageContent = pushMessageContent;
    this.createTime = createTime;
    this.createUserId = createUserId;
    this.createUserName = createUserName;
  }

  // Property accessors

  public Integer getId() {
    return this.id;
  }

  public void setId(Integer id) {
    this.id = id;
  }

  public String getPushMessageTitle() {
    return pushMessageTitle;
  }

  public void setPushMessageTitle(String pushMessageTitle) {
    this.pushMessageTitle = pushMessageTitle;
  }

  public String getPushMessageContent() {
    return pushMessageContent;
  }

  public void setPushMessageContent(String pushMessageContent) {
    this.pushMessageContent = pushMessageContent;
  }

  public Long getCreateTime() {
    return createTime;
  }

  public void setCreateTime(Long createTime) {
    this.createTime = createTime;
  }

  public String getCreateUserId() {
    return createUserId;
  }

  public void setCreateUserId(String createUserId) {
    this.createUserId = createUserId;
  }

  public String getCreateTimeStr() {
    if(this.getCreateTime()==null){
      return "";
    }
    return DateUtils.longTime2String(this.getCreateTime());
  }

  public void setCreateTimeStr(String createTimeStr) {
    this.createTimeStr = createTimeStr;
  }

  public String getCreateUserName() {
    return createUserName;
  }

  public void setCreateUserName(String createUserName) {
    this.createUserName = createUserName;
  }

  @Override
  public String toString() {
    return "PushMessage [id=" + id + ", pushMessageTitle=" + pushMessageTitle
        + ", pushMessageContent=" + pushMessageContent + ", createTime=" + createTime
        + ", createUserId=" + createUserId + "]";
  }
  
}
